home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 May / EnigmA AMIGA RUN 18 (1997)(G.R. Edizioni)(IT)[!][issue 1997-05][EAR-CD II].iso / softwareupdate / system / amigados / amigadoslibrary / findarg.c < prev    next >
C/C++ Source or Header  |  1996-10-10  |  796b  |  32 lines

  1. /* FindArg.c   V1.0   93-03-09                 */
  2. /* ROM library: "dos.library/FindArg", (V36+)  */
  3. /* Copyright 1993, Anders Bjerin, Amiga C Club */
  4.  
  5.  
  6. #include <dos/dos.h>
  7. #include <dos/rdargs.h>
  8.  
  9. #include <clib/dos_protos.h>
  10. #include <stdio.h>
  11. #include <stdlib.h>
  12.  
  13. /* The command line template we will examine: */
  14. #define MY_COMMAND_LINE_TEMPLATE "SoundFile/A,V=Volume/K/N,F=Filter/S"
  15.  
  16. UBYTE *version = "$VER: FindArg V1.0";
  17.  
  18. int main( int argc, char *argv[] );
  19. int main( int argc, char *argv[] )
  20. {
  21.   int template_position;
  22.  
  23.  
  24.   /* Print the position of the command template named "Volume": */
  25.   /* (It is the second command template = position 1.)         */
  26.   template_position = FindArg( MY_COMMAND_LINE_TEMPLATE, "Volume" );
  27.   printf( "Position: %d\n", template_position );
  28.  
  29.   exit( 0 );
  30. }
  31.  
  32.